@extends('admin.layouts.application')

@section('title')
    <title>成员管理</title>
@stop
@section('css')
    <link href="/assets/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
@stop
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row" style="margin-left: 1rem;">
            <div class="col-sm-8 m-b-xs">
                <a href="{{route('admin.user.create')}}" class="btn btn-primary">添加成员</a>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>文章</h5>
                </div>
                <div class="ibox-content">
                    <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper form-inline" role="grid">

                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable"
                               id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
                            <thead>
                            <tr role="row">
                                <th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"
                                    style="">名称
                                </th>
                                <th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"
                                    style="">备注
                                </th>
                                <th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"
                                    style="">状态
                                </th>
                                <th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"
                                    style="">添加时间
                                </th>
                                <th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"
                                    style="">
                                    操作
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($users as $rv)
                                @if(is_object($rv))
                                    <tr class="gradeA odd">
                                        <td>{{$rv->name}}</td>
                                        <td>{{$rv->des}}</td>
                                        <td>{{$rv->type==1?'正常':'封禁'}}</td>
                                        <td>{{substr($rv->created_at,0,10)}}</td>
                                        <td>
                                            <a data-id="{{$rv->id}}" href="{{route('admin.user.update',$rv->id)}}"
                                               class="label label-danger delete">
                                                <i class="fa fa-trash"></i> 修改</a>
                                        </td>
                                    </tr>
                                @endif
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
@section('js')
    <!-- Data Tables -->
    <script src="/assets/admin/js/plugins/dataTables/jquery.dataTables.js"></script>
    <!-- Page-Level Scripts -->
    <script>
        $(document).ready(function () {
            $('.dataTables-example').dataTable();
        });
    </script>
@stop